1. /* simhcvdc.cpp by K.Tsuru */
  2. // function ID = 415 (reference) BRADIX
  3. /***********************************************
  4. SInteger class
  5. It provides a radix conversion BRADIX ---> DRADIX.
  6. The Horner's method is used.
  7. it is very slow.
  8. ************************************************/
  9. #ifndef SN_H
  10. #include "sn.h"
  11. #endif
  12. SLong SInteger::HConvToDec() const{
  13. if(!Sign(415)) return 0.0;
  14. int j, N = (int)Head()+1;
  15. SLong result(DEC_INT, (uint)N);
  16. result.SetLong( (long)figure(N-1) ); // N >= 1
  17. for(j = N-2; j >= 0; j--){
  18. result = LsMult(result, BRADIX);
  19. result.LsAdd(figure(j));
  20. }
  21. result.SetSign(Sign());
  22. result.CutDown(POP);
  23. return result;
  24. }

simhcvdc.cpp : last modifiled at 2017/03/17 11:10:47(676 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).